﻿@using PlatformNetCore.Entity;
@using Webdiyer.AspNetCore;
@model JobsInfo

<div class="banner banner-staff" style="background-image:url(@(Model.Ad != null && !string.IsNullOrWhiteSpace(Model.Ad.AdImagePC) ? Model.Ad.AdImagePC:"/img/banner/job.jpg"))">
    <div class="txt">
        <div class="nav-container">
            <h1 class="text28 wow fadeInUp">@ViewBag.ParentTitle</h1>
            <ul class="nav wow fadeInUp">
                @foreach (Menu item in ViewBag.MenuTopSecond)
                {
                    <li><a href="@item.Link" class="@(item.MenuCode.Equals(ViewBag.MenuCode)?"active":"")">@item.Title</a></li>
                }
            </ul>
        </div>
    </div>
</div>

<div class="page page-jobs">
    <section class="s1 container">
        <div class="filter">
            <form class="formsearch" action="@Url.Action("Apply","Home")" method="get">
                <div class="row wow fadeInUp">
                    <div class="col-md">
                        <div class="row align-items-center">
                            <div class="col-auto">职能类型</div>
                            <div class="col">
                                @foreach (var item in Model.JobsTypeList)
                                {
                                    <a class="@(item.Selected?"active":"")" href="?jobID=@item.Value&positionID=@ViewBag.PositionID&search=@ViewBag.Search">@item.Text </a>
                                }
                            </div>
                        </div>
                    </div>
                    <div class="col-md-auto">
                        <div class="row align-items-center">
                            <div class="col-auto">职位类型</div>
                            <div class="col">
                                @foreach (var item in Model.PositionTypeList)
                                {
                                    <a class="@(item.Selected?"active":"")" href="?positionID=@item.Value&jobID=@ViewBag.JobID&search=@ViewBag.Search">@item.Text </a>
                                }
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bs wow fadeInUp">
                    <div class="row no-gutters">
                        <div class="col">
                            <input type="hidden" name="jobID" value="@ViewBag.JobID" />
                            <input type="hidden" name="positionID" value="@ViewBag.PositionID" />
                            <input id="keyword" type="search" name="search" value="@ViewBag.Search">
                        </div>
                        <div class="col-auto">
                            <button type="submit">搜索</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </section>
    <section class="s2 container">
        <div class="joblist">
            <div class="row">
                @foreach (Jobs item in Model.Jobs)
                {
                    <div class="col-md-6">
                        <div class="item wow fadeInUp">
                            <h3 class="text28"> <a href="/jobs/jobsdetail?id=@item.ID">@item.Title</a></h3>
                            <div class="note"> <span>部门 @item.Department  </span><span>工作地点 @(!string.IsNullOrWhiteSpace(item.Address) ? item.Address:"无")  </span><span>招聘人数 @item.JobNumber 人</span></div>
                            <div class="pubdate">发布日期  @(item.PublishDate.HasValue? item.PublishDate.Value.ToString("yyyy.MM.dd"):"无")</div>
                        </div>
                    </div>
                }
            </div>
            <footer class="news-footer wow fadeInUp">
                @Html.Pager((IPagedList)Model.Jobs, new PagerOptions()
                {
                        ShowFirstLast = false,
                        PrevPageText = "<",
                        NextPageText = ">",
                        PageIndexParameterName = "pageindex",
                        NumericPagerItemCount = 5,
                        CssClass = "pagination text-center",
                        CurrentPagerItemTemplate = "<li class=\"page-item active\"><a class=\"page-link\" href=\"javascript:;\">{0}</a></li>",
                        DisabledPagerItemTemplate = "<li class=\"page-item disabled\"><a class=\"page-link\" href=\"javascript:;\">{0}</a></li>",
                        PagerItemTemplate = "<li class=\"page-item\">{0}</li>"
                 })
            </footer>
        </div>
    </section>
</div>

